(0) Obligation:

Clauses:

f(0, Y, 0).
f(s(X), Y, Z) :- ','(f(X, Y, U), f(U, Y, Z)).

Query: f(g,a,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

pA(s(X1), X2, X3, X4) :- fB(X1, X2, X5).
pA(s(X1), X2, X3, X4) :- ','(fcB(X1, X2, X5), pA(X5, X2, X3, X4)).
fB(s(X1), X2, X3) :- fB(X1, X2, X4).
fB(s(X1), X2, X3) :- ','(fcB(X1, X2, X4), fB(X4, X2, X3)).
fC(s(X1), X2, X3) :- pA(X1, X2, X4, X3).

Clauses:

qcA(0, X1, 0, 0).
qcA(s(X1), X2, X3, X4) :- ','(fcB(X1, X2, X5), qcA(X5, X2, X3, X4)).
fcB(0, X1, 0).
fcB(s(X1), X2, X3) :- ','(fcB(X1, X2, X4), fcB(X4, X2, X3)).

Afs:

fC(x1, x2, x3)  =  fC(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
fC_in: (b,f,f)
pA_in: (b,f,f,f)
fB_in: (b,f,f)
fcB_in: (b,f,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

FC_IN_GAA(s(X1), X2, X3) → U7_GAA(X1, X2, X3, pA_in_gaaa(X1, X2, X4, X3))
FC_IN_GAA(s(X1), X2, X3) → PA_IN_GAAA(X1, X2, X4, X3)
PA_IN_GAAA(s(X1), X2, X3, X4) → U1_GAAA(X1, X2, X3, X4, fB_in_gaa(X1, X2, X5))
PA_IN_GAAA(s(X1), X2, X3, X4) → FB_IN_GAA(X1, X2, X5)
FB_IN_GAA(s(X1), X2, X3) → U4_GAA(X1, X2, X3, fB_in_gaa(X1, X2, X4))
FB_IN_GAA(s(X1), X2, X3) → FB_IN_GAA(X1, X2, X4)
FB_IN_GAA(s(X1), X2, X3) → U5_GAA(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U5_GAA(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U6_GAA(X1, X2, X3, fB_in_gaa(X4, X2, X3))
U5_GAA(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → FB_IN_GAA(X4, X2, X3)
PA_IN_GAAA(s(X1), X2, X3, X4) → U2_GAAA(X1, X2, X3, X4, fcB_in_gaa(X1, X2, X5))
U2_GAAA(X1, X2, X3, X4, fcB_out_gaa(X1, X2, X5)) → U3_GAAA(X1, X2, X3, X4, pA_in_gaaa(X5, X2, X3, X4))
U2_GAAA(X1, X2, X3, X4, fcB_out_gaa(X1, X2, X5)) → PA_IN_GAAA(X5, X2, X3, X4)

The TRS R consists of the following rules:

fcB_in_gaa(0, X1, 0) → fcB_out_gaa(0, X1, 0)
fcB_in_gaa(s(X1), X2, X3) → U11_gaa(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U11_gaa(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U12_gaa(X1, X2, X3, X4, fcB_in_gaa(X4, X2, X3))
U12_gaa(X1, X2, X3, X4, fcB_out_gaa(X4, X2, X3)) → fcB_out_gaa(s(X1), X2, X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
pA_in_gaaa(x1, x2, x3, x4)  =  pA_in_gaaa(x1)
fB_in_gaa(x1, x2, x3)  =  fB_in_gaa(x1)
fcB_in_gaa(x1, x2, x3)  =  fcB_in_gaa(x1)
0  =  0
fcB_out_gaa(x1, x2, x3)  =  fcB_out_gaa(x1, x3)
U11_gaa(x1, x2, x3, x4)  =  U11_gaa(x1, x4)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x1, x5)
FC_IN_GAA(x1, x2, x3)  =  FC_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x4)
PA_IN_GAAA(x1, x2, x3, x4)  =  PA_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5)  =  U1_GAAA(x1, x5)
FB_IN_GAA(x1, x2, x3)  =  FB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x4)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U2_GAAA(x1, x2, x3, x4, x5)  =  U2_GAAA(x1, x5)
U3_GAAA(x1, x2, x3, x4, x5)  =  U3_GAAA(x1, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FC_IN_GAA(s(X1), X2, X3) → U7_GAA(X1, X2, X3, pA_in_gaaa(X1, X2, X4, X3))
FC_IN_GAA(s(X1), X2, X3) → PA_IN_GAAA(X1, X2, X4, X3)
PA_IN_GAAA(s(X1), X2, X3, X4) → U1_GAAA(X1, X2, X3, X4, fB_in_gaa(X1, X2, X5))
PA_IN_GAAA(s(X1), X2, X3, X4) → FB_IN_GAA(X1, X2, X5)
FB_IN_GAA(s(X1), X2, X3) → U4_GAA(X1, X2, X3, fB_in_gaa(X1, X2, X4))
FB_IN_GAA(s(X1), X2, X3) → FB_IN_GAA(X1, X2, X4)
FB_IN_GAA(s(X1), X2, X3) → U5_GAA(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U5_GAA(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U6_GAA(X1, X2, X3, fB_in_gaa(X4, X2, X3))
U5_GAA(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → FB_IN_GAA(X4, X2, X3)
PA_IN_GAAA(s(X1), X2, X3, X4) → U2_GAAA(X1, X2, X3, X4, fcB_in_gaa(X1, X2, X5))
U2_GAAA(X1, X2, X3, X4, fcB_out_gaa(X1, X2, X5)) → U3_GAAA(X1, X2, X3, X4, pA_in_gaaa(X5, X2, X3, X4))
U2_GAAA(X1, X2, X3, X4, fcB_out_gaa(X1, X2, X5)) → PA_IN_GAAA(X5, X2, X3, X4)

The TRS R consists of the following rules:

fcB_in_gaa(0, X1, 0) → fcB_out_gaa(0, X1, 0)
fcB_in_gaa(s(X1), X2, X3) → U11_gaa(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U11_gaa(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U12_gaa(X1, X2, X3, X4, fcB_in_gaa(X4, X2, X3))
U12_gaa(X1, X2, X3, X4, fcB_out_gaa(X4, X2, X3)) → fcB_out_gaa(s(X1), X2, X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
pA_in_gaaa(x1, x2, x3, x4)  =  pA_in_gaaa(x1)
fB_in_gaa(x1, x2, x3)  =  fB_in_gaa(x1)
fcB_in_gaa(x1, x2, x3)  =  fcB_in_gaa(x1)
0  =  0
fcB_out_gaa(x1, x2, x3)  =  fcB_out_gaa(x1, x3)
U11_gaa(x1, x2, x3, x4)  =  U11_gaa(x1, x4)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x1, x5)
FC_IN_GAA(x1, x2, x3)  =  FC_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x4)
PA_IN_GAAA(x1, x2, x3, x4)  =  PA_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5)  =  U1_GAAA(x1, x5)
FB_IN_GAA(x1, x2, x3)  =  FB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x4)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U2_GAAA(x1, x2, x3, x4, x5)  =  U2_GAAA(x1, x5)
U3_GAAA(x1, x2, x3, x4, x5)  =  U3_GAAA(x1, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FB_IN_GAA(s(X1), X2, X3) → U5_GAA(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U5_GAA(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → FB_IN_GAA(X4, X2, X3)
FB_IN_GAA(s(X1), X2, X3) → FB_IN_GAA(X1, X2, X4)

The TRS R consists of the following rules:

fcB_in_gaa(0, X1, 0) → fcB_out_gaa(0, X1, 0)
fcB_in_gaa(s(X1), X2, X3) → U11_gaa(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U11_gaa(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U12_gaa(X1, X2, X3, X4, fcB_in_gaa(X4, X2, X3))
U12_gaa(X1, X2, X3, X4, fcB_out_gaa(X4, X2, X3)) → fcB_out_gaa(s(X1), X2, X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
fcB_in_gaa(x1, x2, x3)  =  fcB_in_gaa(x1)
0  =  0
fcB_out_gaa(x1, x2, x3)  =  fcB_out_gaa(x1, x3)
U11_gaa(x1, x2, x3, x4)  =  U11_gaa(x1, x4)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x1, x5)
FB_IN_GAA(x1, x2, x3)  =  FB_IN_GAA(x1)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x4)

We have to consider all (P,R,Pi)-chains

(8) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FB_IN_GAA(s(X1)) → U5_GAA(X1, fcB_in_gaa(X1))
U5_GAA(X1, fcB_out_gaa(X1, X4)) → FB_IN_GAA(X4)
FB_IN_GAA(s(X1)) → FB_IN_GAA(X1)

The TRS R consists of the following rules:

fcB_in_gaa(0) → fcB_out_gaa(0, 0)
fcB_in_gaa(s(X1)) → U11_gaa(X1, fcB_in_gaa(X1))
U11_gaa(X1, fcB_out_gaa(X1, X4)) → U12_gaa(X1, fcB_in_gaa(X4))
U12_gaa(X1, fcB_out_gaa(X4, X3)) → fcB_out_gaa(s(X1), X3)

The set Q consists of the following terms:

fcB_in_gaa(x0)
U11_gaa(x0, x1)
U12_gaa(x0, x1)

We have to consider all (P,Q,R)-chains.

(10) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

FB_IN_GAA(s(X1)) → U5_GAA(X1, fcB_in_gaa(X1))
FB_IN_GAA(s(X1)) → FB_IN_GAA(X1)


Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(FB_IN_GAA(x1)) = 2 + 2·x1   
POL(U11_gaa(x1, x2)) = 1 + x1 + x2   
POL(U12_gaa(x1, x2)) = 1 + 2·x1 + x2   
POL(U5_GAA(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(fcB_in_gaa(x1)) = x1   
POL(fcB_out_gaa(x1, x2)) = x1 + x2   
POL(s(x1)) = 1 + 2·x1   

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U5_GAA(X1, fcB_out_gaa(X1, X4)) → FB_IN_GAA(X4)

The TRS R consists of the following rules:

fcB_in_gaa(0) → fcB_out_gaa(0, 0)
fcB_in_gaa(s(X1)) → U11_gaa(X1, fcB_in_gaa(X1))
U11_gaa(X1, fcB_out_gaa(X1, X4)) → U12_gaa(X1, fcB_in_gaa(X4))
U12_gaa(X1, fcB_out_gaa(X4, X3)) → fcB_out_gaa(s(X1), X3)

The set Q consists of the following terms:

fcB_in_gaa(x0)
U11_gaa(x0, x1)
U12_gaa(x0, x1)

We have to consider all (P,Q,R)-chains.

(12) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(13) TRUE

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

PA_IN_GAAA(s(X1), X2, X3, X4) → U2_GAAA(X1, X2, X3, X4, fcB_in_gaa(X1, X2, X5))
U2_GAAA(X1, X2, X3, X4, fcB_out_gaa(X1, X2, X5)) → PA_IN_GAAA(X5, X2, X3, X4)

The TRS R consists of the following rules:

fcB_in_gaa(0, X1, 0) → fcB_out_gaa(0, X1, 0)
fcB_in_gaa(s(X1), X2, X3) → U11_gaa(X1, X2, X3, fcB_in_gaa(X1, X2, X4))
U11_gaa(X1, X2, X3, fcB_out_gaa(X1, X2, X4)) → U12_gaa(X1, X2, X3, X4, fcB_in_gaa(X4, X2, X3))
U12_gaa(X1, X2, X3, X4, fcB_out_gaa(X4, X2, X3)) → fcB_out_gaa(s(X1), X2, X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
fcB_in_gaa(x1, x2, x3)  =  fcB_in_gaa(x1)
0  =  0
fcB_out_gaa(x1, x2, x3)  =  fcB_out_gaa(x1, x3)
U11_gaa(x1, x2, x3, x4)  =  U11_gaa(x1, x4)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x1, x5)
PA_IN_GAAA(x1, x2, x3, x4)  =  PA_IN_GAAA(x1)
U2_GAAA(x1, x2, x3, x4, x5)  =  U2_GAAA(x1, x5)

We have to consider all (P,R,Pi)-chains

(15) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PA_IN_GAAA(s(X1)) → U2_GAAA(X1, fcB_in_gaa(X1))
U2_GAAA(X1, fcB_out_gaa(X1, X5)) → PA_IN_GAAA(X5)

The TRS R consists of the following rules:

fcB_in_gaa(0) → fcB_out_gaa(0, 0)
fcB_in_gaa(s(X1)) → U11_gaa(X1, fcB_in_gaa(X1))
U11_gaa(X1, fcB_out_gaa(X1, X4)) → U12_gaa(X1, fcB_in_gaa(X4))
U12_gaa(X1, fcB_out_gaa(X4, X3)) → fcB_out_gaa(s(X1), X3)

The set Q consists of the following terms:

fcB_in_gaa(x0)
U11_gaa(x0, x1)
U12_gaa(x0, x1)

We have to consider all (P,Q,R)-chains.

(17) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

PA_IN_GAAA(s(X1)) → U2_GAAA(X1, fcB_in_gaa(X1))


Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(PA_IN_GAAA(x1)) = 2 + 2·x1   
POL(U11_gaa(x1, x2)) = 1 + x1 + x2   
POL(U12_gaa(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(U2_GAAA(x1, x2)) = 2 + x1 + 2·x2   
POL(fcB_in_gaa(x1)) = x1   
POL(fcB_out_gaa(x1, x2)) = x1 + 2·x2   
POL(s(x1)) = 1 + 2·x1   

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_GAAA(X1, fcB_out_gaa(X1, X5)) → PA_IN_GAAA(X5)

The TRS R consists of the following rules:

fcB_in_gaa(0) → fcB_out_gaa(0, 0)
fcB_in_gaa(s(X1)) → U11_gaa(X1, fcB_in_gaa(X1))
U11_gaa(X1, fcB_out_gaa(X1, X4)) → U12_gaa(X1, fcB_in_gaa(X4))
U12_gaa(X1, fcB_out_gaa(X4, X3)) → fcB_out_gaa(s(X1), X3)

The set Q consists of the following terms:

fcB_in_gaa(x0)
U11_gaa(x0, x1)
U12_gaa(x0, x1)

We have to consider all (P,Q,R)-chains.

(19) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(20) TRUE